package com.chuangsi.project.admin.dto.app.order;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.chuangsi.project.system.domain.File;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;

/**
 * @ClassName: FileDto
 * @Description: TODO
 * @Author: Naomi
 * @Date: 2022/11/24 15:57
 * Version: 1.0
 */
@Data
public class FileDto {


    @ApiModelProperty(value = "文件id")
    @NotEmpty(message = "文件id不能为空")
    @Size(max = 32, message = "文件id长度过长")
    private String fileId;

    @ApiModelProperty(value = "文件地址")
    @NotEmpty(message="文件地址不能为空")
    @Size(max=256,message="文件地址长度过长")
    private String uri;

    @ApiModelProperty(value = "文件名称")
    @Size(max=128,message="文件名称长度过长")
    private String fileName;

    @ApiModelProperty(value = "文件类型（1.文件，2.图片，3视频）")
    @Size(max=1,message="文件类型（1.文件，2.图片，3视频）长度过长")
    private String fileType;

    public FileDto() {
    }

    public FileDto(String uri, String fileName, String fileType) {
        this.uri = uri;
        this.fileName = fileName;
        this.fileType = fileType;
    }

    public FileDto(File file) {
        this.fileId = file.getFileId();
        this.uri = file.getUri();
        this.fileName = file.getFileName();
        this.fileType = file.getFileType();
    }
}
